// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
#pragma once

namespace Weathr
{
    class LiveTileScheduler
    {
    public:
        LiveTileScheduler();
        concurrency::task<void> UpdateLiveTileImagesAsync(Forecast^ forecast, Windows::UI::Xaml::UIElement^ hugeElement, Windows::UI::Xaml::UIElement^ wideElement, Windows::UI::Xaml::UIElement^ squareElement);
        void UpdateLiveTile();

        concurrency::task<void> UpdateSecondaryTileImagesAsync(Forecast^ forecast, Windows::UI::Xaml::UIElement^ hugeElement, Windows::UI::Xaml::UIElement^ wideElement, Windows::UI::Xaml::UIElement^ squareElement);

        Windows::Foundation::Uri^ GetSecondaryTileHugeUri() const;
        Windows::Foundation::Uri^ GetSecondaryTileWideUri() const;
        Windows::Foundation::Uri^ GetSecondaryTileSquareUri() const;
    private:
        uint32_t m_nextFileIndex;
        std::vector<uint32_t> m_fileIndices;
        Windows::UI::Notifications::TileUpdater^ m_tileUpdater;

        uint32_t GetNextFileIndex();
        concurrency::task<void> InternalUpdateLiveTileImagesAsync(Forecast^ forecast, Windows::UI::Xaml::UIElement^ element, Platform::String^ fileName, unsigned int imageWidth, unsigned int imageHeight);
    };
}